﻿using System;
using System.Data;
using UniMana.Data;
using UniMana.Utils.Data;

namespace UniMana.Win.Training
{
    public partial class FrmScore_ViewInfoEditScore : DevExpress.XtraEditors.XtraForm
    {
        private DBMain m_Score = new DBMain();
        public FrmScore_ViewInfoEditScore()
        {
            InitializeComponent();
        }
        public FrmScore_ViewInfoEditScore(int subjectClassKey, string studentKey)
        {
            InitializeComponent();
            try
            {
                Training_StudentInfo infoStudent = new Training_StudentInfo(studentKey);
                lbcStudentName.Text = "Họ tên: " + infoStudent.Properties.LastName.ToString() + " " + infoStudent.Properties.SureName.ToString();
                Training_Student_ClassInfo infoStudentClass = new Training_Student_ClassInfo(Guid.Parse(studentKey));
                lbcStudentID.Text = "MSSV: " + infoStudentClass.Properties.ID;
                Training_Subject_ClassInfo infoSubjectClass = new Training_Subject_ClassInfo(subjectClassKey);
                lbcSubjectClassID.Text = "Mã lớp học phần: " + infoSubjectClass.Properties.ID;
                lbcSubjectClassName.Text = "Tên lớp học phần: " + infoSubjectClass.Properties.Name;
                DataTable dtInfo = m_Score.m_DCReadOnly.Log_ScoreEdits.GetInfoEditScore(m_Score.m_DCReadOnly.Personnel_Personnels,
                                                                                m_Score.m_DCReadOnly.Training_ScoreTypes,
                                                                                subjectClassKey, studentKey).ToDataTable();
                gctInfoEditScore.DataSource = dtInfo;
            }
            catch { }
        }
    }
}